package online.sanen.mhdt.entity;
/**
 * 英雄基本属性
 * @author Administrator
 */
public class HeroAttr {
	private double str2Ad=1.5;
	private double mag2Ap=1.5;
	private double mag2Mp=5;
	private double mag2MagDef=1;
	private double con2Hp=10;
	private double vit2Def=2;
	private double agi2Sp=1;
	private int str;
	private int mag;
	private int con;
	private int vit;
	private int agi;
	/**血上限,当前血量*/
	private int hp,hpCurrent;
	/**蓝上限,当前蓝量*/
	private int mp,mpCurrent;
	/**物攻*/
	private int ad;
	/**法功(灵力)*/
	private int ap;
	/**物防*/
	private int def;
	/**法防*/
	private int magDef;
	/**速度*/
	private int sp;
	private Hero hero;
	public HeroAttr() {
		
	}

	public HeroAttr(Hero hero) {
		this.hero=hero;
	}
	/**
	 * 刷新属性
	 */
	public void refreshAttr() {
		AttrPoint point=hero.getAttrPoint();
		HeroEquip equip=hero.getHeroEquip();
		this.str=point.getStr()+equip.getStr();
		this.mag=point.getMag()+equip.getMag();
		this.con=point.getCon()+equip.getCon();
		this.vit=point.getVit()+equip.getVit();
		this.agi=point.getAgi()+equip.getAgi();

		this.hp=(int) (con*con2Hp+0.5+equip.getHp());
		this.mp= (int) (mag*mag2Mp+0.5+equip.getMp());
		this.ad= (int) (str*str2Ad+0.5)+equip.getAd();
		this.ap= (int) (mag*mag2Ap+0.5)+equip.getAp();
		this.def= (int) (vit*vit2Def+0.5+equip.getDef());
		this.magDef= (int) (mag*mag2MagDef+0.5+equip.getMagDef());
		this.sp= (int) (agi*agi2Sp+0.5+equip.getSp());
	}
	public int getStr() {
		return str;
	}
	public void setStr(int str) {
		this.str = str;
	}
	public int getMag() {
		return mag;
	}
	public void setMag(int mag) {
		this.mag = mag;
	}
	public int getCon() {
		return con;
	}
	public void setCon(int con) {
		this.con = con;
	}
	public int getVit() {
		return vit;
	}
	public void setVit(int vit) {
		this.vit = vit;
	}
	public int getAgi() {
		return agi;
	}
	public void setAgi(int agi) {
		this.agi = agi;
	}
	public int getHp() {
		return hp;
	}
	public void setHp(int hp) {
		this.hp = hp;
	}
	public int getHpCurrent() {
		return hpCurrent;
	}
	public void setHpCurrent(int hpCurrent) {
		this.hpCurrent = hpCurrent;
	}
	public int getMp() {
		return mp;
	}
	public void setMp(int mp) {
		this.mp = mp;
	}
	public int getMpCurrent() {
		return mpCurrent;
	}
	public void setMpCurrent(int mpCurrent) {
		this.mpCurrent = mpCurrent;
	}
	public int getAd() {
		return ad;
	}
	public void setAd(int ad) {
		this.ad = ad;
	}
	public int getAp() {
		return ap;
	}
	public void setAp(int ap) {
		this.ap = ap;
	}
	public int getDef() {
		return def;
	}
	public void setDef(int def) {
		this.def = def;
	}
	public int getMagDef() {
		return magDef;
	}
	public void setMagDef(int magDef) {
		this.magDef = magDef;
	}
	public int getSp() {
		return sp;
	}
	public void setSp(int sp) {
		this.sp = sp;
	}
	public Hero getHero() {
		return hero;
	}
	public void setHero(Hero hero) {
		this.hero = hero;
	}
	
}
